//入口文件
import Vue from 'vue'

//1.1导入路由的包
import VueRouter from 'vue-router'

//1.2安装路由ue.use(VueRouter)
Vue.use(VueRouter)

//导入格式化时间插件
import moment from 'moment'
//定义全局的过滤器
Vue.filter('dateFormat', function(dataStr, pattern = "YYYY-MM-DD HH:mm:ss") {
    return moment(dataStr).format(pattern)
})

//2.1 导入vue-resource 
import VueResource from 'vue-resource'
//2.2 安装vue-resource
Vue.use(VueResource)

//设置请求的根路径
Vue.http.options.root = "http://www.liulongbin.top:3005"
    //设置全局post表单数据格式
Vue.http.options.emulateJson = true;



// 导入mui的样式
import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'

//按需导入mint-ui中的组件
// import { Header, Swipe, SwipeItem, Button, Lazyload } from 'mint-ui'
// Vue.component(Header.name, Header)
// Vue.component(Swipe.name, Swipe)
// Vue.component(SwipeItem.name, SwipeItem)
// Vue.component(Button.name, Button);
// Vue.use(Lazyload);

import MintUI from 'mint-ui'
Vue.use(MintUI)
import 'mint-ui/lib/style.css'

//安装图片预览插件
import VuePreview from 'vue-preview'

// defalut install
Vue.use(VuePreview)


//1.3 导入自己的router.js路由模块
import router from './router.js'
//导入状态管理对象
import store from './store.js'



//导入app根组件
import app from './App.vue'
var vm = new Vue({
    el: "#app",
    render: c => c(app),
    router, //1.4挂载路由对象到vm实例上
    store //挂载 store


})